<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDownloadsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('downloads', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->comment('创建人')->nullable()->default(0);
            $table->string('name', '120')->comment('文件名称');
            $table->string('url', '255')->comment('下载链接');
            $table->tinyInteger('status')
                ->comment('状态 0正在生成文件 1已生成可下载');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('downloads');
    }
}
